<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//添加留言
$username = $_POST['username'];
$sex = $_POST['sex'];
$message = $_POST['message'];
$imgurl = $_POST['imgurl'];
$time_at = time();


require 'data/db_emp_conn.php';
$sql = "INSERT INTO bbs.dbconn
    (`id`, `username`, `sex`, `content`, `avater`, `time_at`)
    VALUES
    (null,'$username','$sex','$message','$imgurl','$time_at')";


$result = $conn->query($sql);
if($result === false){
    echo '數據庫操作失敗！(;′⌒`)';
}
 else {
    header('Location: index.php');    
}